//
//  myImageView.m
//  Fragrance
//
//  Created by mark on 15/5/25.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "myImageView.h"
#import "ClassificationViewController.h"
@implementation myImageView

- (id)initWithImage:(UIImage *)image text:(NSString *)text
{
    self = [super init];
    if (self) {
        UIImageView *imageview = [[UIImageView alloc] initWithImage:image];
        imageview.frame = CGRectMake(20, 0, 60, 60);
        imageview.layer.masksToBounds = YES;
        imageview.layer.cornerRadius = imageview.frame.size.width / 2;
        imageview.backgroundColor = [UIColor redColor];
        [self addSubview:imageview];
        [imageview release];
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 60, 60, 20)];
        
        label.font = [UIFont systemFontOfSize:13];
        label.text = text;
        label.textColor = [UIColor whiteColor];
        [self addSubview:label];
        [label release];
        
        
    }
    return self;
}

- (void)setdege:(id)ID
{
    self.userInteractionEnabled = YES;
    dege = ID;
}

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    ClassificationViewController *tmp = (ClassificationViewController *)dege;
    [tmp Clickup:self.tag];
}






/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
